package com.superman.supermarket.client.widget.button;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.HTML;
import com.superman.mvpframe.client.gin.XGinjector;
import com.superman.supermarket.client.gin.ShopGinjector;

/**
 * 分类按钮
 * 
 * @author superman
 * @version 2018年8月13日下午4:15:10
 */
public class CategoriesButton extends HTML {
	/**
	 * 构造方法
	 * 
	 * @author superman
	 * @version 2018年8月13日 下午4:15:32
	 */
	public CategoriesButton() {
		this.addStyleName("fa fa-navicon fa-2x");
		this.getElement().getStyle().setProperty("width", "0.8rem");
		this.getElement().getStyle().setProperty("height", "0.8rem");
		this.getElement().getStyle().setProperty("lineHeight", "0.8rem");
		this.getElement().getStyle().setProperty("textAlign", "center");
		this.getElement().getStyle().setProperty("color", "#666");
		this.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				XGinjector.INSTANCE.getMyPlaceController().push(ShopGinjector.INSTANCE.getMyPlaceFactory().getSkuCategoriesPlace());
			}
		});
	}
}
